package action;

import java.util.ArrayList;

import DAO.Dao_Trust;
import Entity.TrustDistricts;

import com.opensymphony.xwork2.ActionSupport;

public class DetailTrustDictrict extends ActionSupport{
	private String nameTD;
	private String desTD;
	private String region;
	private boolean active;
	private String nameTR;

	private TrustDistricts TrusDis;
	private ArrayList<TrustDistricts> listTrusDis;

	public String execute() throws Exception{
		Dao_Trust cont = new Dao_Trust();
		listTrusDis = cont.getTrustDistricts();

		int sizeList = listTrusDis.size();
		for (int i = 0; i < sizeList; i++) {

			if (listTrusDis.get(i).getNameTD().equals(nameTD)) {
				setTrusDis(new TrustDistricts(listTrusDis.get(i).getNameTD(), listTrusDis.get(i)
						.getDesTD(), listTrusDis.get(i).getRegion(), listTrusDis.get(i)
						.isActive(), listTrusDis.get(i).getNameTR()));
			}
		}
		getTrusDis();
		return "success";
	}

	public String getNameTD() {
		return nameTD;
	}

	public void setNameTD(String nameTD) {
		this.nameTD = nameTD;
	}

	public String getDesTD() {
		return desTD;
	}

	public void setDesTD(String desTD) {
		this.desTD = desTD;
	}

	public String getRegion() {
		return region;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public String getNameTR() {
		return nameTR;
	}

	public void setNameTR(String nameTR) {
		this.nameTR = nameTR;
	}

	public TrustDistricts getTrusDis() {
		return TrusDis;
	}

	public void setTrusDis(TrustDistricts trusDis) {
		TrusDis = trusDis;
	}

	public ArrayList<TrustDistricts> getListTrusDis() {
		return listTrusDis;
	}

	public void setListTrusDis(ArrayList<TrustDistricts> listTrusDis) {
		this.listTrusDis = listTrusDis;
	}
	
	
}
